package com.maven.demo.core.constant;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author yanwl
 * @date 2015年7月25日
 */
public class Globals {
	private static final Logger log = LoggerFactory.getLogger(Globals.class);
	private static Properties config = new Properties();
	
	static {
		String configFile = System.getProperty("user.home") + File.separator + "demo.properties";
		if(log.isInfoEnabled()) {
			log.info("加载全局配置文件："+configFile);
		}
		try {
			config.load(new FileInputStream(configFile));
		}catch (FileNotFoundException e) {
			e.printStackTrace();
		}catch(IOException e) {
			e.printStackTrace();
		}
	}
	
	public static final String userName = config.getProperty("jdbc.username", "").trim();
	public static final String password = config.getProperty("jdbc.password", "").trim();
	
	public static final String PIC_UPLOAD_URL = config.getProperty("pic.upload.url","").trim();
	public static final String PIC_DEL_URL = config.getProperty("pic.del.url","").trim();
	public static final String PIC_SHOW_URL = config.getProperty("pic.show.url","").trim();
}
